<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="../css/style.css" />
<script type="text/javascript">
	function RadioCheck(){

        size = document.formname.elements['mc_charge'].length;

        for(var i = 0; i < size; i++) {
        	if(document.formname.elements["mc_charge"][i].checked) {
        		var on = document.getElementById('mc_chargetxt');
        		on.disabled = true;
	        	if(document.formname.elements['mc_charge'][i].value == ""){
	        		document.getElementById('mc_chargetxt').value = '';
	        		var off = document.getElementById('mc_chargetxt');
	        		off.disabled = false;
	        		if(document.formname.elements['mc_charge'][i].value != ''){
	        			document.getElementById('mc_chargetxt').value = document.formname.elements['mc_charge'][i].value;
		        		break;
	        		}
	        		break;
	        	}
	        	/* var won = Number(document.getElementById('mc_charge').value);//
	        	var point = Number(document.formname.elements['mc_chargetxt'][i].value); */
        		//document.getElementById('mc_charge').value = String(won + point);
        		document.getElementById('mc_chargetxt').value = document.formname.elements['mc_charge'][i].value;
            	break;
        	}
       	}
	}
	function checkIt(){
		if(document.formname.mc_chargetxt.value==""){
			alert("마일리지를 선택하세요");
			document.formname.mc_chargetxt.focus();
			return false;
		}
	}
	/* //결제 페이지 팝업
	function payment(user) {
		//스크린의 크기
		sw=screen.availWidth;
		sh=screen.availHeight;
		
		//열 창의 포지션
		px=(sw-450)/2;
		py=(sh-600)/2;

		window.open("../main/paymentMilegeForm.do,결제창","scrollbars=yes,status=no, width=450, height=600, resizable=yes, menubar=no, top=" + py + ", left=" + px);
		return true; 
	} */
</script>
</head>
<body>
<form:form name="formname" commandName="memberCommand" onsubmit="return checkIt()">

<table border="0" width="400px">
	<tr><td colspan="2">
			<img src="../images/m.png">
			<hr color="#e10380">
		</td>
	</tr>
	<tr><td colspan="2"><b style="font-size: 15px">충전할 마일리지를 클릭하고 "결제"버튼을 클릭하세요.</b></td> 
	</tr>
	<tr><td><input type="radio" name="mc_charge" value="3000"  onClick="RadioCheck()">3,000원 -> 3000point</td>
	</tr>
	<tr><td><input type="radio" name="mc_charge" value="5000"  onClick="RadioCheck()">5,000원 -> 5000point</td>
	</tr>
	<tr><td><input type="radio" name="mc_charge" value="10000" onclick="RadioCheck()">10,000원 -> 10000point</td>
	</tr>
	<tr><td><input type="radio" name="mc_charge" value="20000" onclick="RadioCheck()">20,000원 -> 20000point</td>
	</tr>
	<tr><td><input type="radio" name="mc_charge" value="30000" onclick="RadioCheck()">30,000원 -> 30000point</td>
	</tr>
	<tr><td><input type="radio" name="mc_charge" value="50000" onclick="RadioCheck()">50,000원 -> 50000point</td>
	</tr>
	<tr><td><input type="radio" name="mc_charge" value="100000" onclick="RadioCheck()">100,000원 -> 100000point</td>
	</tr>
	<tr><td><input type="radio" name="mc_charge" value="2000000" onclick="RadioCheck()">200,000원 -> 200000point</td>
	</tr>
	<tr><td><input type="radio" name="mc_charge" value="3000000" onclick="RadioCheck()">300,000원 -> 300000point</td>
	</tr>
	<tr><td><input type="radio" name="mc_charge" value="5000000" onclick="RadioCheck()">500,000원 -> 500000point</td>
	</tr>
	<tr>
		<td align="right" colspan="2">
			<font size="5px" style="font-family: 맑은 고딕; font-style: inherit;">결제금액 : </font>
			<input height="2" style="font-family: 맑은 고딕; font-size: 15px; right: 0px;" type="text" disabled name="mc_chargetxt" id="mc_chargetxt"  maxlength="6">원<br>
			<input type="submit" class="pay" value="결제">
			<input type="reset" class="pay" value="지우기">
		</td> 
	</tr>  
</table>
</form:form>
</body>
</html>